home *** CD-ROM | disk | FTP | other *** search
MacBinary | 1992-03-05 | 4.6 KB | [TEXT/KAHL] |
open in:
MacOS 8.1
|
Win98
|
DOS
view JSON data
|
view as text
This file was processed as: MacBinary
(archive/macBinary).
You can browse this item here: FileIO.c
Confidence | Program | Detection | Match Type | Support
|
---|
66%
| dexvert
| Compact Compressed (Unix) (archive/compact)
| ext
| Supported |
10%
| dexvert
| MacBinary (archive/macBinary)
| fallback
| Supported |
1%
| dexvert
| Text File (text/txt)
| fallback
| Supported |
100%
| file
| MacBinary II, inited, Thu Mar 5 12:28:53 1992, modified Thu Mar 5 12:28:53 1992, creator Think C, type ASCII, 4172 bytes "FileIO.c" , at 0x10cc 348 bytes resource
| default (weak)
| |
99%
| file
| data
| default
| |
74%
| TrID
| Macintosh plain text (MacBinary)
| default
| |
25%
| TrID
| MacBinary 2
| default (weak)
| |
100%
| siegfried
| fmt/1762 MacBinary (II)
| default
| |
100%
| lsar
| MacBinary
| default
|
|
id metadata |
---|
key | value |
---|
macFileType | [TEXT] |
macFileCreator | [KAHL] |
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 08 46 69 6c 65 49 4f | 2e 63 00 00 00 00 00 00 |..FileIO|.c......|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 4b 41 48 | 4c 01 00 00 00 00 00 00 |.TEXTKAH|L.......|
|00000050| 00 00 00 00 00 10 4c 00 | 00 01 5c a5 dc 0a d5 a5 |......L.|..\.....|
|00000060| dc 0a d5 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 cb ac 00 00 |........|........|
|00000080| 2f 2a 20 41 6c 6c 20 72 | 69 67 68 74 73 20 72 65 |/* All r|ights re|
|00000090| 73 65 72 76 65 64 2e 20 | 43 6f 70 79 72 69 67 68 |served. |Copyrigh|
|000000a0| 74 20 52 6f 6e 20 41 76 | 69 74 7a 75 72 20 2d 20 |t Ron Av|itzur - |
|000000b0| 31 39 39 32 0d 2a 2f 0d | 0d 23 69 6e 63 6c 75 64 |1992.*/.|.#includ|
|000000c0| 65 20 22 52 65 63 6f 67 | 6e 69 7a 65 72 2e 68 22 |e "Recog|nizer.h"|
|000000d0| 0d 0d 65 78 74 65 72 6e | 20 4c 69 73 74 20 70 61 |..extern| List pa|
|000000e0| 74 74 65 72 6e 73 3b 0d | 0d 76 6f 69 64 20 57 72 |tterns;.|.void Wr|
|000000f0| 69 74 65 44 61 74 61 28 | 46 49 4c 45 20 2a 66 69 |iteData(|FILE *fi|
|00000100| 6c 65 29 3b 0d 76 6f 69 | 64 20 57 72 69 74 65 47 |le);.voi|d WriteG|
|00000110| 65 73 74 75 72 65 50 61 | 74 74 65 72 6e 28 46 49 |esturePa|ttern(FI|
|00000120| 4c 45 20 2a 66 69 6c 65 | 2c 47 65 73 74 75 72 65 |LE *file|,Gesture|
|00000130| 50 61 74 74 65 72 6e 20 | 2a 67 70 29 3b 0d 76 6f |Pattern |*gp);.vo|
|00000140| 69 64 20 57 72 69 74 65 | 53 74 72 6f 6b 65 50 61 |id Write|StrokePa|
|00000150| 74 74 65 72 6e 28 46 49 | 4c 45 20 2a 66 69 6c 65 |ttern(FI|LE *file|
|00000160| 2c 53 74 72 6f 6b 65 50 | 61 74 74 65 72 6e 20 2a |,StrokeP|attern *|
|00000170| 73 70 29 3b 0d 76 6f 69 | 64 20 52 65 61 64 44 61 |sp);.voi|d ReadDa|
|00000180| 74 61 28 46 49 4c 45 20 | 2a 66 69 6c 65 29 3b 0d |ta(FILE |*file);.|
|00000190| 76 6f 69 64 20 52 65 61 | 64 47 65 73 74 75 72 65 |void Rea|dGesture|
|000001a0| 50 61 74 74 65 72 6e 28 | 46 49 4c 45 20 2a 66 69 |Pattern(|FILE *fi|
|000001b0| 6c 65 2c 47 65 73 74 75 | 72 65 50 61 74 74 65 72 |le,Gestu|rePatter|
|000001c0| 6e 20 2a 67 70 29 3b 0d | 76 6f 69 64 20 52 65 61 |n *gp);.|void Rea|
|000001d0| 64 53 74 72 6f 6b 65 50 | 61 74 74 65 72 6e 28 46 |dStrokeP|attern(F|
|000001e0| 49 4c 45 20 2a 66 69 6c | 65 2c 53 74 72 6f 6b 65 |ILE *fil|e,Stroke|
|000001f0| 50 61 74 74 65 72 6e 20 | 2a 73 70 29 3b 0d 76 6f |Pattern |*sp);.vo|
|00000200| 69 64 20 43 6f 6e 73 74 | 72 75 63 74 53 74 72 28 |id Const|ructStr(|
|00000210| 48 61 6e 64 6c 65 20 68 | 2c 4c 69 73 74 20 73 2c |Handle h|,List s,|
|00000220| 73 68 6f 72 74 20 62 69 | 74 73 2c 63 68 61 72 20 |short bi|ts,char |
|00000230| 2a 6e 61 6d 65 29 3b 0d | 76 6f 69 64 20 49 6e 74 |*name);.|void Int|
|00000240| 65 72 70 72 65 74 53 74 | 72 28 63 68 61 72 20 2a |erpretSt|r(char *|
|00000250| 73 74 72 2c 4c 69 73 74 | 20 2a 73 2c 73 68 6f 72 |str,List| *s,shor|
|00000260| 74 20 62 69 74 73 2c 63 | 68 61 72 20 2a 6e 61 6d |t bits,c|har *nam|
|00000270| 65 29 3b 0d 0d 73 68 6f | 72 74 20 47 65 74 54 6f |e);..sho|rt GetTo|
|00000280| 6b 65 6e 28 63 68 61 72 | 20 2a 74 6f 6b 65 6e 2c |ken(char| *token,|
|00000290| 63 68 61 72 20 2a 2a 73 | 70 29 3b 0d 73 68 6f 72 |char **s|p);.shor|
|000002a0| 74 20 47 65 74 54 6f 6b | 65 6e 28 63 68 61 72 20 |t GetTok|en(char |
|000002b0| 2a 74 6f 6b 65 6e 2c 63 | 68 61 72 20 2a 2a 73 70 |*token,c|har **sp|
|000002c0| 29 0d 09 7b 0d 09 73 68 | 6f 72 74 20 69 20 3d 20 |)..{..sh|ort i = |
|000002d0| 30 3b 0d 09 77 68 69 6c | 65 20 28 2a 73 70 20 26 |0;..whil|e (*sp &|
|000002e0| 26 20 2a 2a 73 70 20 3d | 3d 20 27 20 27 29 20 28 |& **sp =|= ' ') (|
|000002f0| 2a 73 70 29 2b 2b 3b 0d | 09 77 68 69 6c 65 20 28 |*sp)++;.|.while (|
|00000300| 2a 73 70 20 26 26 20 2a | 2a 73 70 20 21 3d 20 27 |*sp && *|*sp != '|
|00000310| 20 27 20 26 26 20 2a 2a | 73 70 20 21 3d 20 27 5c | ' && **|sp != '\|
|00000320| 6e 27 29 20 7b 0d 09 09 | 74 6f 6b 65 6e 5b 69 2b |n') {...|token[i+|
|00000330| 2b 5d 20 3d 20 2a 2a 73 | 70 3b 0d 09 09 28 2a 73 |+] = **s|p;...(*s|
|00000340| 70 29 2b 2b 3b 0d 09 09 | 7d 0d 09 74 6f 6b 65 6e |p)++;...|}..token|
|00000350| 5b 69 5d 20 3d 20 30 3b | 0d 09 72 65 74 75 72 6e |[i] = 0;|..return|
|00000360| 20 69 20 21 3d 20 30 3b | 0d 09 7d 0d 0d 76 6f 69 | i != 0;|..}..voi|
|00000370| 64 20 49 6e 74 65 72 70 | 72 65 74 53 74 72 28 63 |d Interp|retStr(c|
|00000380| 68 61 72 20 2a 73 74 72 | 2c 4c 69 73 74 20 2a 73 |har *str|,List *s|
|00000390| 2c 73 68 6f 72 74 20 62 | 69 74 73 2c 63 68 61 72 |,short b|its,char|
|000003a0| 20 2a 6e 61 6d 65 29 0d | 09 7b 0d 09 63 68 61 72 | *name).|.{..char|
|000003b0| 20 74 6f 6b 65 6e 5b 33 | 30 5d 3b 0d 09 75 6e 73 | token[3|0];..uns|
|000003c0| 69 67 6e 65 64 20 6c 6f | 6e 67 20 6e 3b 0d 09 73 |igned lo|ng n;..s|
|000003d0| 68 6f 72 74 20 69 3b 0d | 0d 09 69 66 20 28 6e 61 |hort i;.|..if (na|
|000003e0| 6d 65 29 20 66 6f 72 20 | 28 69 20 3d 20 30 3b 20 |me) for |(i = 0; |
|000003f0| 69 20 3c 20 73 74 72 6c | 65 6e 28 73 74 72 29 3b |i < strl|en(str);|
|00000400| 20 69 2b 2b 29 20 7b 0d | 09 09 69 66 09 09 09 28 | i++) {.|..if...(|
|00000410| 73 74 72 5b 69 5d 20 3d | 3d 20 6e 61 6d 65 5b 30 |str[i] =|= name[0|
|00000420| 5d 29 20 73 74 72 5b 69 | 5d 20 3d 20 27 30 27 3b |]) str[i|] = '0';|
|00000430| 0d 09 09 65 6c 73 65 20 | 69 66 09 28 73 74 72 5b |...else |if.(str[|
|00000440| 69 5d 20 3d 3d 20 6e 61 | 6d 65 5b 31 5d 29 20 73 |i] == na|me[1]) s|
|00000450| 74 72 5b 69 5d 20 3d 20 | 27 31 27 3b 0d 09 09 65 |tr[i] = |'1';...e|
|00000460| 6c 73 65 20 69 66 09 28 | 73 74 72 5b 69 5d 20 3d |lse if.(|str[i] =|
|00000470| 3d 20 6e 61 6d 65 5b 32 | 5d 29 20 73 74 72 5b 69 |= name[2|]) str[i|
|00000480| 5d 20 3d 20 27 32 27 3b | 0d 09 09 65 6c 73 65 20 |] = '2';|...else |
|00000490| 69 66 09 28 73 74 72 5b | 69 5d 20 3d 3d 20 6e 61 |if.(str[|i] == na|
|000004a0| 6d 65 5b 33 5d 29 20 73 | 74 72 5b 69 5d 20 3d 20 |me[3]) s|tr[i] = |
|000004b0| 27 33 27 3b 0d 09 09 7d | 0d 09 77 68 69 6c 65 20 |'3';...}|..while |
|000004c0| 28 47 65 74 54 6f 6b 65 | 6e 28 74 6f 6b 65 6e 2c |(GetToke|n(token,|
|000004d0| 26 73 74 72 29 29 20 7b | 0d 09 09 43 6f 6e 76 65 |&str)) {|...Conve|
|000004e0| 72 74 53 74 72 69 6e 67 | 54 6f 4c 6f 6e 67 28 74 |rtString|ToLong(t|
|000004f0| 6f 6b 65 6e 2c 26 6e 2c | 62 69 74 73 29 3b 0d 09 |oken,&n,|bits);..|
|00000500| 09 41 70 70 65 6e 64 28 | 73 2c 6e 29 3b 0d 09 09 |.Append(|s,n);...|
|00000510| 7d 0d 09 7d 0d 0d 76 6f | 69 64 20 43 6f 6e 73 74 |}..}..vo|id Const|
|00000520| 72 75 63 74 53 74 72 28 | 68 2c 73 2c 62 69 74 73 |ructStr(|h,s,bits|
|00000530| 2c 6e 61 6d 65 29 0d 20 | 48 61 6e 64 6c 65 20 68 |,name). |Handle h|
|00000540| 3b 0d 20 4c 69 73 74 20 | 73 3b 0d 20 73 68 6f 72 |;. List |s;. shor|
|00000550| 74 20 62 69 74 73 3b 0d | 20 63 68 61 72 20 2a 6e |t bits;.| char *n|
|00000560| 61 6d 65 3b 0d 09 7b 0d | 09 63 68 61 72 20 73 74 |ame;..{.|.char st|
|00000570| 72 5b 32 35 35 5d 3b 0d | 09 73 68 6f 72 74 20 69 |r[255];.|.short i|
|00000580| 2c 6a 2c 6c 65 6e 3b 0d | 0d 09 48 55 6e 6c 6f 63 |,j,len;.|..HUnloc|
|00000590| 6b 28 68 29 3b 0d 09 53 | 65 74 48 61 6e 64 6c 65 |k(h);..S|etHandle|
|000005a0| 53 69 7a 65 28 68 2c 30 | 29 3b 0d 09 69 66 20 28 |Size(h,0|);..if (|
|000005b0| 73 20 3d 3d 20 4e 49 4c | 29 20 72 65 74 75 72 6e |s == NIL|) return|
|000005c0| 3b 0d 09 66 6f 72 20 28 | 69 20 3d 20 30 3b 20 69 |;..for (|i = 0; i|
|000005d0| 20 3c 20 73 2d 3e 6e 75 | 6d 5f 69 74 65 6d 73 3b | < s->nu|m_items;|
|000005e0| 20 69 2b 2b 29 20 7b 0d | 09 09 43 6f 6e 76 65 72 | i++) {.|..Conver|
|000005f0| 74 4c 6f 6e 67 54 6f 53 | 74 72 69 6e 67 28 73 74 |tLongToS|tring(st|
|00000600| 72 2c 28 6c 6f 6e 67 29 | 73 2d 3e 69 74 65 6d 73 |r,(long)|s->items|
|00000610| 5b 69 5d 2c 62 69 74 73 | 2c 6e 61 6d 65 29 3b 0d |[i],bits|,name);.|
|00000620| 09 09 6c 65 6e 20 3d 20 | 47 65 74 48 61 6e 64 6c |..len = |GetHandl|
|00000630| 65 53 69 7a 65 28 68 29 | 3b 0d 09 09 53 65 74 48 |eSize(h)|;...SetH|
|00000640| 61 6e 64 6c 65 53 69 7a | 65 28 68 2c 6c 65 6e 20 |andleSiz|e(h,len |
|00000650| 2b 20 73 74 72 6c 65 6e | 28 73 74 72 29 20 2b 20 |+ strlen|(str) + |
|00000660| 31 29 3b 0d 09 09 66 6f | 72 20 28 6a 20 3d 20 6c |1);...fo|r (j = l|
|00000670| 65 6e 3b 20 6a 20 3c 20 | 6c 65 6e 20 2b 20 73 74 |en; j < |len + st|
|00000680| 72 6c 65 6e 28 73 74 72 | 29 3b 20 6a 2b 2b 29 0d |rlen(str|); j++).|
|00000690| 09 09 09 28 2a 68 29 5b | 6a 5d 20 3d 20 73 74 72 |...(*h)[|j] = str|
|000006a0| 5b 6a 20 2d 20 6c 65 6e | 5d 3b 0d 09 09 28 2a 68 |[j - len|];...(*h|
|000006b0| 29 5b 6a 5d 20 3d 20 27 | 20 27 3b 0d 09 09 7d 0d |)[j] = '| ';...}.|
|000006c0| 09 28 2a 68 29 5b 6a 5d | 20 3d 20 30 3b 0d 09 48 |.(*h)[j]| = 0;..H|
|000006d0| 4c 6f 63 6b 28 68 29 3b | 0d 09 7d 0d 0d 76 6f 69 |Lock(h);|..}..voi|
|000006e0| 64 20 52 65 61 64 50 61 | 74 74 65 72 6e 73 28 29 |d ReadPa|tterns()|
|000006f0| 0d 09 7b 0d 09 46 49 4c | 45 20 2a 66 69 6c 65 3b |..{..FIL|E *file;|
|00000700| 0d 09 66 69 6c 65 20 3d | 20 66 6f 70 65 6e 28 22 |..file =| fopen("|
|00000710| 72 78 61 2e 64 61 74 22 | 2c 22 72 22 29 3b 0d 09 |rxa.dat"|,"r");..|
|00000720| 52 65 61 64 44 61 74 61 | 28 66 69 6c 65 29 3b 0d |ReadData|(file);.|
|00000730| 09 66 63 6c 6f 73 65 28 | 66 69 6c 65 29 3b 0d 09 |.fclose(|file);..|
|00000740| 4d 61 6b 65 53 65 61 72 | 63 68 54 61 62 6c 65 73 |MakeSear|chTables|
|00000750| 28 29 3b 0d 09 7d 0d 0d | 76 6f 69 64 20 53 61 76 |();..}..|void Sav|
|00000760| 65 50 61 74 74 65 72 6e | 73 28 29 0d 09 7b 0d 09 |ePattern|s()..{..|
|00000770| 46 49 4c 45 20 2a 66 69 | 6c 65 3b 0d 09 66 69 6c |FILE *fi|le;..fil|
|00000780| 65 20 3d 20 66 6f 70 65 | 6e 28 22 72 78 61 2e 64 |e = fope|n("rxa.d|
|00000790| 61 74 22 2c 22 77 22 29 | 3b 0d 09 57 72 69 74 65 |at","w")|;..Write|
|000007a0| 44 61 74 61 28 66 69 6c | 65 29 3b 0d 09 66 63 6c |Data(fil|e);..fcl|
|000007b0| 6f 73 65 28 66 69 6c 65 | 29 3b 0d 09 7d 0d 0d 76 |ose(file|);..}..v|
|000007c0| 6f 69 64 20 52 65 61 64 | 44 61 74 61 28 66 69 6c |oid Read|Data(fil|
|000007d0| 65 29 0d 20 46 49 4c 45 | 20 2a 66 69 6c 65 3b 0d |e). FILE| *file;.|
|000007e0| 09 7b 0d 09 73 68 6f 72 | 74 20 69 2c 6e 75 6d 5f |.{..shor|t i,num_|
|000007f0| 70 61 74 74 65 72 6e 73 | 3b 0d 09 66 73 63 61 6e |patterns|;..fscan|
|00000800| 66 28 66 69 6c 65 2c 22 | 25 64 20 50 61 74 74 65 |f(file,"|%d Patte|
|00000810| 72 6e 73 5c 6e 5c 6e 22 | 2c 26 6e 75 6d 5f 70 61 |rns\n\n"|,&num_pa|
|00000820| 74 74 65 72 6e 73 29 3b | 0d 09 69 66 20 28 6e 75 |tterns);|..if (nu|
|00000830| 6d 5f 70 61 74 74 65 72 | 6e 73 20 3d 3d 20 30 29 |m_patter|ns == 0)|
|00000840| 20 7b 0d 09 09 41 70 70 | 65 6e 64 28 26 70 61 74 | {...App|end(&pat|
|00000850| 74 65 72 6e 73 2c 30 4c | 29 3b 0d 09 09 70 61 74 |terns,0L|);...pat|
|00000860| 74 65 72 6e 73 2d 3e 6e | 75 6d 5f 69 74 65 6d 73 |terns->n|um_items|
|00000870| 20 3d 20 30 3b 0d 09 09 | 7d 0d 09 66 6f 72 20 28 | = 0;...|}..for (|
|00000880| 69 20 3d 20 30 3b 20 69 | 20 3c 20 6e 75 6d 5f 70 |i = 0; i| < num_p|
|00000890| 61 74 74 65 72 6e 73 3b | 20 69 2b 2b 29 0d 09 09 |atterns;| i++)...|
|000008a0| 7b 0d 09 09 47 65 73 74 | 75 72 65 50 61 74 74 65 |{...Gest|urePatte|
|000008b0| 72 6e 20 2a 67 70 20 3d | 20 6d 61 6c 6c 6f 63 28 |rn *gp =| malloc(|
|000008c0| 73 69 7a 65 6f 66 28 47 | 65 73 74 75 72 65 50 61 |sizeof(G|esturePa|
|000008d0| 74 74 65 72 6e 29 29 3b | 0d 09 09 69 66 20 28 67 |ttern));|...if (g|
|000008e0| 70 20 3d 3d 20 4e 49 4c | 29 20 7b 53 79 73 42 65 |p == NIL|) {SysBe|
|000008f0| 65 70 28 31 29 3b 20 44 | 65 62 75 67 67 65 72 28 |ep(1); D|ebugger(|
|00000900| 29 3b 20 45 78 69 74 54 | 6f 53 68 65 6c 6c 28 29 |); ExitT|oShell()|
|00000910| 3b 7d 0d 09 09 67 70 2d | 3e 73 74 72 6f 6b 65 73 |;}...gp-|>strokes|
|00000920| 20 3d 20 4e 49 4c 3b 0d | 09 09 52 65 61 64 47 65 | = NIL;.|..ReadGe|
|00000930| 73 74 75 72 65 50 61 74 | 74 65 72 6e 28 66 69 6c |sturePat|tern(fil|
|00000940| 65 2c 67 70 29 3b 0d 09 | 09 41 70 70 65 6e 64 28 |e,gp);..|.Append(|
|00000950| 26 70 61 74 74 65 72 6e | 73 2c 28 6c 6f 6e 67 29 |&pattern|s,(long)|
|00000960| 67 70 29 3b 0d 09 09 7d | 0d 09 7d 0d 0d 76 6f 69 |gp);...}|..}..voi|
|00000970| 64 20 57 72 69 74 65 44 | 61 74 61 28 66 69 6c 65 |d WriteD|ata(file|
|00000980| 29 0d 20 46 49 4c 45 20 | 2a 66 69 6c 65 3b 0d 09 |). FILE |*file;..|
|00000990| 7b 0d 09 73 68 6f 72 74 | 20 69 3b 0d 09 66 70 72 |{..short| i;..fpr|
|000009a0| 69 6e 74 66 28 66 69 6c | 65 2c 22 25 64 20 50 61 |intf(fil|e,"%d Pa|
|000009b0| 74 74 65 72 6e 73 5c 6e | 5c 6e 22 2c 70 61 74 74 |tterns\n|\n",patt|
|000009c0| 65 72 6e 73 2d 3e 6e 75 | 6d 5f 69 74 65 6d 73 29 |erns->nu|m_items)|
|000009d0| 3b 0d 09 66 6f 72 20 28 | 69 20 3d 20 30 3b 20 69 |;..for (|i = 0; i|
|000009e0| 20 3c 20 70 61 74 74 65 | 72 6e 73 2d 3e 6e 75 6d | < patte|rns->num|
|000009f0| 5f 69 74 65 6d 73 3b 20 | 69 2b 2b 29 0d 09 09 57 |_items; |i++)...W|
|00000a00| 72 69 74 65 47 65 73 74 | 75 72 65 50 61 74 74 65 |riteGest|urePatte|
|00000a10| 72 6e 28 66 69 6c 65 2c | 70 61 74 74 65 72 6e 73 |rn(file,|patterns|
|00000a20| 2d 3e 69 74 65 6d 73 5b | 69 5d 29 3b 0d 09 7d 0d |->items[|i]);..}.|
|00000a30| 0d 76 6f 69 64 20 52 65 | 61 64 47 65 73 74 75 72 |.void Re|adGestur|
|00000a40| 65 50 61 74 74 65 72 6e | 28 46 49 4c 45 20 2a 66 |ePattern|(FILE *f|
|00000a50| 69 6c 65 2c 47 65 73 74 | 75 72 65 50 61 74 74 65 |ile,Gest|urePatte|
|00000a60| 72 6e 20 2a 67 70 29 0d | 09 7b 0d 09 73 68 6f 72 |rn *gp).|.{..shor|
|00000a70| 74 20 69 2c 6a 2c 6e 75 | 6d 5f 73 74 72 6f 6b 65 |t i,j,nu|m_stroke|
|00000a80| 73 3b 20 63 68 61 72 20 | 63 3b 20 63 68 61 72 20 |s; char |c; char |
|00000a90| 73 74 72 5b 32 35 35 5d | 3b 0d 09 66 73 63 61 6e |str[255]|;..fscan|
|00000aa0| 66 28 66 69 6c 65 2c 22 | 25 73 5c 6e 22 2c 73 74 |f(file,"|%s\n",st|
|00000ab0| 72 29 3b 0d 09 69 66 20 | 28 73 74 72 6c 65 6e 28 |r);..if |(strlen(|
|00000ac0| 73 74 72 29 20 3d 3d 20 | 31 29 0d 09 09 09 67 70 |str) == |1)....gp|
|00000ad0| 2d 3e 63 6f 64 65 20 3d | 20 73 74 72 5b 30 5d 3b |->code =| str[0];|
|00000ae0| 0d 09 65 6c 73 65 09 73 | 73 63 61 6e 66 28 73 74 |..else.s|scanf(st|
|00000af0| 72 2c 22 25 78 22 2c 26 | 67 70 2d 3e 63 6f 64 65 |r,"%x",&|gp->code|
|00000b00| 29 3b 0d 0d 09 66 73 63 | 61 6e 66 28 66 69 6c 65 |);...fsc|anf(file|
|00000b10| 2c 22 20 25 64 5c 6e 22 | 2c 26 6e 75 6d 5f 73 74 |," %d\n"|,&num_st|
|00000b20| 72 6f 6b 65 73 29 3b 0d | 09 66 6f 72 20 28 69 20 |rokes);.|.for (i |
|00000b30| 3d 20 30 3b 20 69 20 3c | 20 6e 75 6d 5f 73 74 72 |= 0; i <| num_str|
|00000b40| 6f 6b 65 73 3b 20 69 2b | 2b 29 0d 09 09 7b 0d 09 |okes; i+|+)...{..|
|00000b50| 09 53 74 72 6f 6b 65 50 | 61 74 74 65 72 6e 20 20 |.StrokeP|attern |
|00000b60| 2a 73 70 20 3d 20 6d 61 | 6c 6c 6f 63 28 73 69 7a |*sp = ma|lloc(siz|
|00000b70| 65 6f 66 28 53 74 72 6f | 6b 65 50 61 74 74 65 72 |eof(Stro|kePatter|
|00000b80| 6e 29 29 3b 0d 09 09 69 | 66 20 28 73 70 20 3d 3d |n));...i|f (sp ==|
|00000b90| 20 4e 49 4c 29 20 7b 53 | 79 73 42 65 65 70 28 31 | NIL) {S|ysBeep(1|
|00000ba0| 29 3b 20 44 65 62 75 67 | 67 65 72 28 29 3b 20 45 |); Debug|ger(); E|
|00000bb0| 78 69 74 54 6f 53 68 65 | 6c 6c 28 29 3b 7d 0d 09 |xitToShe|ll();}..|
|00000bc0| 09 73 70 2d 3e 69 73 5f | 64 6f 74 20 3d 20 30 3b |.sp->is_|dot = 0;|
|00000bd0| 0d 09 09 66 6f 72 20 28 | 6a 3d 30 3b 6a 3c 4e 55 |...for (|j=0;j<NU|
|00000be0| 4d 5f 46 45 41 54 55 52 | 45 53 3b 6a 2b 2b 29 20 |M_FEATUR|ES;j++) |
|00000bf0| 73 70 2d 3e 73 5b 6a 5d | 20 3d 20 4e 49 4c 3b 0d |sp->s[j]| = NIL;.|
|00000c00| 09 09 52 65 61 64 53 74 | 72 6f 6b 65 50 61 74 74 |..ReadSt|rokePatt|
|00000c10| 65 72 6e 28 66 69 6c 65 | 2c 73 70 29 3b 0d 09 09 |ern(file|,sp);...|
|00000c20| 41 70 70 65 6e 64 28 26 | 67 70 2d 3e 73 74 72 6f |Append(&|gp->stro|
|00000c30| 6b 65 73 2c 28 6c 6f 6e | 67 29 73 70 29 3b 0d 09 |kes,(lon|g)sp);..|
|00000c40| 09 7d 0d 09 66 73 63 61 | 6e 66 28 66 69 6c 65 2c |.}..fsca|nf(file,|
|00000c50| 22 5c 6e 22 29 3b 0d 09 | 7d 0d 0d 76 6f 69 64 20 |"\n");..|}..void |
|00000c60| 57 72 69 74 65 47 65 73 | 74 75 72 65 50 61 74 74 |WriteGes|turePatt|
|00000c70| 65 72 6e 28 46 49 4c 45 | 20 2a 66 69 6c 65 2c 47 |ern(FILE| *file,G|
|00000c80| 65 73 74 75 72 65 50 61 | 74 74 65 72 6e 20 2a 67 |esturePa|ttern *g|
|00000c90| 70 29 0d 09 7b 0d 09 73 | 68 6f 72 74 20 69 3b 0d |p)..{..s|hort i;.|
|00000ca0| 0d 09 69 66 20 28 67 70 | 2d 3e 63 6f 64 65 20 3c |..if (gp|->code <|
|00000cb0| 3d 20 30 78 37 45 20 26 | 26 20 67 70 2d 3e 63 6f |= 0x7E &|& gp->co|
|00000cc0| 64 65 20 3e 3d 20 30 78 | 32 31 29 09 66 70 72 69 |de >= 0x|21).fpri|
|00000cd0| 6e 74 66 28 66 69 6c 65 | 2c 20 22 25 63 5c 6e 22 |ntf(file|, "%c\n"|
|00000ce0| 2c 67 70 2d 3e 63 6f 64 | 65 29 3b 0d 09 65 6c 73 |,gp->cod|e);..els|
|00000cf0| 65 20 69 66 20 28 67 70 | 2d 3e 63 6f 64 65 20 3c |e if (gp|->code <|
|00000d00| 3d 20 30 78 66 29 09 09 | 09 09 09 09 66 70 72 69 |= 0xf)..|....fpri|
|00000d10| 6e 74 66 28 66 69 6c 65 | 2c 22 30 25 78 5c 6e 22 |ntf(file|,"0%x\n"|
|00000d20| 2c 67 70 2d 3e 63 6f 64 | 65 29 3b 0d 09 65 6c 73 |,gp->cod|e);..els|
|00000d30| 65 09 09 09 09 09 09 09 | 09 09 09 09 09 09 66 70 |e.......|......fp|
|00000d40| 72 69 6e 74 66 28 66 69 | 6c 65 2c 20 22 25 78 5c |rintf(fi|le, "%x\|
|00000d50| 6e 22 2c 67 70 2d 3e 63 | 6f 64 65 29 3b 0d 0d 09 |n",gp->c|ode);...|
|00000d60| 66 70 72 69 6e 74 66 28 | 66 69 6c 65 2c 22 20 25 |fprintf(|file," %|
|00000d70| 64 5c 6e 22 2c 67 70 2d | 3e 73 74 72 6f 6b 65 73 |d\n",gp-|>strokes|
|00000d80| 2d 3e 6e 75 6d 5f 69 74 | 65 6d 73 29 3b 0d 09 66 |->num_it|ems);..f|
|00000d90| 6f 72 20 28 69 20 3d 20 | 30 3b 20 69 20 3c 20 67 |or (i = |0; i < g|
|00000da0| 70 2d 3e 73 74 72 6f 6b | 65 73 2d 3e 6e 75 6d 5f |p->strok|es->num_|
|00000db0| 69 74 65 6d 73 3b 20 69 | 2b 2b 29 0d 09 09 57 72 |items; i|++)...Wr|
|00000dc0| 69 74 65 53 74 72 6f 6b | 65 50 61 74 74 65 72 6e |iteStrok|ePattern|
|00000dd0| 28 66 69 6c 65 2c 67 70 | 2d 3e 73 74 72 6f 6b 65 |(file,gp|->stroke|
|00000de0| 73 2d 3e 69 74 65 6d 73 | 5b 69 5d 29 3b 0d 09 66 |s->items|[i]);..f|
|00000df0| 70 72 69 6e 74 66 28 66 | 69 6c 65 2c 22 5c 6e 22 |printf(f|ile,"\n"|
|00000e00| 29 3b 0d 09 7d 0d 0d 76 | 6f 69 64 20 52 65 61 64 |);..}..v|oid Read|
|00000e10| 53 74 72 6f 6b 65 50 61 | 74 74 65 72 6e 28 46 49 |StrokePa|ttern(FI|
|00000e20| 4c 45 20 2a 66 69 6c 65 | 2c 53 74 72 6f 6b 65 50 |LE *file|,StrokeP|
|00000e30| 61 74 74 65 72 6e 20 2a | 73 70 29 0d 09 7b 0d 09 |attern *|sp)..{..|
|00000e40| 63 68 61 72 20 2a 70 2c | 74 79 70 65 2c 73 74 72 |char *p,|type,str|
|00000e50| 5b 31 30 30 30 5d 2c 69 | 3b 0d 09 0d 09 77 68 69 |[1000],i|;....whi|
|00000e60| 6c 65 20 28 54 52 55 45 | 29 20 7b 0d 09 09 66 67 |le (TRUE|) {...fg|
|00000e70| 65 74 73 28 73 74 72 2c | 31 30 30 30 2c 66 69 6c |ets(str,|1000,fil|
|00000e80| 65 29 3b 0d 09 09 69 66 | 20 28 73 74 72 5b 30 5d |e);...if| (str[0]|
|00000e90| 20 3d 3d 20 27 5c 6e 27 | 29 09 72 65 74 75 72 6e | == '\n'|).return|
|00000ea0| 3b 0d 09 09 69 66 20 28 | 73 74 72 5b 30 5d 20 3d |;...if (|str[0] =|
|00000eb0| 3d 20 27 5c 74 27 29 09 | 7b 20 74 79 70 65 20 3d |= '\t').|{ type =|
|00000ec0| 20 73 74 72 5b 31 5d 3b | 20 70 20 3d 20 26 73 74 | str[1];| p = &st|
|00000ed0| 72 5b 33 5d 3b 20 7d 0d | 09 09 65 6c 73 65 09 09 |r[3]; }.|..else..|
|00000ee0| 09 09 09 09 7b 20 74 79 | 70 65 20 3d 20 73 74 72 |....{ ty|pe = str|
|00000ef0| 5b 30 5d 3b 20 70 20 3d | 20 26 73 74 72 5b 32 5d |[0]; p =| &str[2]|
|00000f00| 3b 20 7d 0d 09 09 69 66 | 20 28 74 79 70 65 20 3d |; }...if| (type =|
|00000f10| 3d 20 27 61 27 29 09 09 | 73 70 2d 3e 69 73 5f 64 |= 'a')..|sp->is_d|
|00000f20| 6f 74 20 3d 20 31 3b 0d | 09 09 65 6c 73 65 20 69 |ot = 1;.|..else i|
|00000f30| 66 20 28 28 69 20 3d 20 | 74 79 70 65 20 2d 20 27 |f ((i = |type - '|
|00000f40| 62 27 29 20 3c 20 4e 55 | 4d 5f 46 45 41 54 55 52 |b') < NU|M_FEATUR|
|00000f50| 45 53 29 0d 09 09 09 49 | 6e 74 65 72 70 72 65 74 |ES)....I|nterpret|
|00000f60| 53 74 72 28 70 2c 26 73 | 70 2d 3e 73 5b 69 5d 2c |Str(p,&s|p->s[i],|
|00000f70| 42 69 74 73 5b 69 5d 2c | 4e 61 6d 65 73 5b 69 5d |Bits[i],|Names[i]|
|00000f80| 29 3b 0d 09 09 7d 0d 09 | 7d 0d 0d 0d 76 6f 69 64 |);...}..|}...void|
|00000f90| 20 57 72 69 74 65 53 74 | 72 6f 6b 65 50 61 74 74 | WriteSt|rokePatt|
|00000fa0| 65 72 6e 28 46 49 4c 45 | 20 2a 66 69 6c 65 2c 53 |ern(FILE| *file,S|
|00000fb0| 74 72 6f 6b 65 50 61 74 | 74 65 72 6e 20 2a 73 70 |trokePat|tern *sp|
|00000fc0| 29 0d 09 7b 0d 09 73 68 | 6f 72 74 20 69 3b 0d 09 |)..{..sh|ort i;..|
|00000fd0| 48 61 6e 64 6c 65 20 68 | 20 3d 20 4e 65 77 48 61 |Handle h| = NewHa|
|00000fe0| 6e 64 6c 65 28 30 29 3b | 0d 09 69 66 20 28 73 70 |ndle(0);|..if (sp|
|00000ff0| 2d 3e 69 73 5f 64 6f 74 | 29 20 66 70 72 69 6e 74 |->is_dot|) fprint|
|00001000| 66 28 66 69 6c 65 2c 22 | 5c 74 61 5c 6e 22 29 3b |f(file,"|\ta\n");|
|00001010| 0d 09 66 6f 72 20 28 69 | 3d 30 3b 69 3c 4e 55 4d |..for (i|=0;i<NUM|
|00001020| 5f 46 45 41 54 55 52 45 | 53 3b 69 2b 2b 29 20 69 |_FEATURE|S;i++) i|
|00001030| 66 20 28 73 70 2d 3e 73 | 5b 69 5d 29 20 7b 0d 09 |f (sp->s|[i]) {..|
|00001040| 09 43 6f 6e 73 74 72 75 | 63 74 53 74 72 28 68 2c |.Constru|ctStr(h,|
|00001050| 73 70 2d 3e 73 5b 69 5d | 2c 42 69 74 73 5b 69 5d |sp->s[i]|,Bits[i]|
|00001060| 2c 4e 61 6d 65 73 5b 69 | 5d 29 3b 0d 09 09 66 70 |,Names[i|]);...fp|
|00001070| 72 69 6e 74 66 28 66 69 | 6c 65 2c 22 5c 74 25 63 |rintf(fi|le,"\t%c|
|00001080| 3a 20 25 73 5c 6e 22 2c | 28 63 68 61 72 29 28 27 |: %s\n",|(char)('|
|00001090| 62 27 20 2b 20 69 29 2c | 2a 68 29 3b 0d 09 09 7d |b' + i),|*h);...}|
|000010a0| 0d 09 66 70 72 69 6e 74 | 66 28 66 69 6c 65 2c 22 |..fprint|f(file,"|
|000010b0| 5c 6e 22 29 3b 0d 09 44 | 69 73 70 6f 73 48 61 6e |\n");..D|isposHan|
|000010c0| 64 6c 65 28 68 29 3b 0d | 09 7d 0d 0d 00 00 00 00 |dle(h);.|.}......|
|000010d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000010e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000010f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001100| 00 00 01 00 00 00 01 16 | 00 00 00 16 00 00 00 46 |........|.......F|
|00001110| ff fa 60 22 30 6e ff fa | d1 ee 00 08 10 10 48 80 |..`"0n..|......H.|
|00001120| 48 c0 d0 ae ff fc 06 80 | ff ff ff d0 e5 88 2d 40 |H.......|......-@|
|00001130| 08 46 69 6c 65 49 4f 2e | 63 6c 02 00 00 00 54 45 |.FileIO.|cl....TE|
|00001140| 58 54 4b 41 48 4c 01 00 | 00 14 00 00 00 00 00 00 |XTKAHL..|........|
|00001150| 00 00 54 45 58 54 4b 41 | 48 4c 01 00 00 14 00 00 |..TEXTKA|HL......|
|00001160| 00 00 31 09 00 00 00 00 | 00 00 00 00 00 00 00 00 |..1.....|........|
|00001170| 00 00 a5 17 e1 0d 00 00 | 10 4c 00 00 01 5c 00 00 |........|.L...\..|
|00001180| 58 8f 3d 40 ff f4 30 6e | ff f4 d1 ee 00 08 32 6e |X.=@..0n|......2n|
|00001190| ff f4 d3 ee 00 08 10 a9 | ff ff 52 6e ff f4 42 6e |........|..Rn..Bn|
|000011a0| ff f6 60 22 30 6e ff f6 | d1 ee 00 08 10 10 48 80 |..`"0n..|......H.|
|000011b0| 48 c0 d0 ae ff fc 06 80 | ff ff ff d0 e7 88 2d 40 |H.......|......-@|
|000011c0| ff fc 52 6e ff f6 0c 6e | 00 0a ff f6 6c 0a 30 2e |..Rn...n|....l.0.|
|000011d0| ff f6 b0 6e ff f4 6d cc | 70 0a 3d 40 ff f6 60 22 |...n..m.|p.=@..`"|
|000011e0| 30 6e ff f6 d1 ee 00 08 | 10 10 48 80 48 c0 d0 ae |0n......|..H.H...|
|000011f0| ff f8 06 80 ff ff ff d0 | e7 88 2d 40 ff f8 52 6e |........|..-@..Rn|
|00001200| 00 00 00 04 00 06 00 03 | 00 00 00 0a 00 09 06 4d |........|.......M|
|00001210| 6f 6e 61 63 6f 2c 00 00 | 01 00 00 00 01 16 00 00 |onaco,..|........|
|00001220| 00 16 00 00 00 46 00 25 | a0 b4 03 ae 00 00 00 1c |.....F.%|........|
|00001230| 00 46 00 01 45 54 41 42 | 00 00 00 12 45 46 4e 54 |.F..ETAB|....EFNT|
|00001240| 00 00 00 1e 03 ec ff ff | 00 00 00 00 00 25 9f 88 |........|.....%..|
|00001250| 03 eb ff ff 00 00 00 08 | 00 25 a0 b8 00 00 00 00 |........|.%......|
|00001260| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001270| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+